Exercise: Using Conditions on Arrays
In this exercise, you will be using multiple conditions on arrays.
We'll cover the following
Task#
In this exercise, you will be using conditions on NumPy arrays.
Problem statement#
- Create an array for variable
xconsisting of values from to . - Compute and store it in a variable
y. - Store all values of
ythat are greater than or less than in one array.
- Store all values of
ythat are greater than and less than in another array.
can be accessed using
np.pi.
can be used as
np.sin(x).
We will discuss the solution to this exercise in the next lesson.
Solution Review: Accessing 2-Dimensional Arrays
Solution Review: Using Conditions on Arrays